﻿using System;
using NCP.Util.CusAttributes;
using SqlSugar;

namespace NCP.Model
{
    [Serializable]
    [SugarTable("Member")]
    public class Member:BaseModel
    {
        public string Name { get; set; }

        public string Code { get; set; }

        public string Pwd { get; set; }

        public string Status { get; set; }

        public string Remark { get; set; }

        public string DeptCode { get; set; }

        [SugarColumn(IsIgnore = true)]
        [Explain(CacheKey =KeyEnum.Dept,SourceField = "DeptCode")]
        public string DeptName { get; set; }

        //身份证
        public string Idenno { get; set; }

        public string MemberType { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string MemberTypeStr {
            get {
                if ("D".Equals(MemberType))
                    return "医生";
                if ("N".Equals(MemberType))
                    return "护士";
                if ("O".Equals(MemberType))
                    return "其他";
                return "";
            }
        }

        [SugarColumn(IsIgnore = true)]
        public bool IsSysAdmin { get { return "sysadmin".Equals(Code); } }
    }
}
